﻿CREATE PROCEDURE [dbo].[sp_Update_LoginFailedTimes]
	@Id VARCHAR(10), 
	@Times INT
AS
		IF @Times = 3
		BEGIN
			UPDATE [dbo].[Accounts]
			SET [FailedLoginTimes] = @Times, [Status] = 1 WHERE AccountID = @Id
		END
		ELSE
		BEGIN
			UPDATE [dbo].[Accounts]
			SET [FailedLoginTimes] = @Times WHERE AccountID = @Id
		END
	
RETURN 0;